cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModule/")
find_package(Halcon REQUIRED)
find_package(Threads REQUIRED)
set(CMAKE_CXX_STANDARD 11)

# ## load in pkg-config support
find_package(PkgConfig)
## use pkg-config to get hints for 0mq locations
pkg_check_modules(PC_ZeroMQ QUIET zmq)

## use the hint from above to find where 'zmq.hpp' is located
find_path(ZeroMQ_INCLUDE_DIR
        NAMES zmq.hpp
        PATHS ${PC_ZeroMQ_INCLUDE_DIRS}
        )

## use the hint from about to find the location of libzmq
find_library(ZeroMQ_LIBRARY
        NAMES zmq
        PATHS ${PC_ZeroMQ_LIBRARY_DIRS}
        )

include_directories( ${ZeroMQ_INCLUDE_DIR} ${Halcon_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/client_server_interface ${CMAKE_SOURCE_DIR}/plugin_interface)

ADD_EXECUTABLE (server server.cpp)
target_link_libraries(server ${ZeroMQ_LIBRARY} ${Halcon_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} pluma clientServerInterface pluginInterface)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)